@extends("/paging_template",minWidth=1000)
@import com.mgfireworks.mgplatform.mgadmin.constants.*
@import com.mgfireworks.mgplatform.mgadmin.product.model.*
@import com.mgfireworks.mgplatform.mgadmin.sys.model.*
@args List<Product> productList,List<Category> categoryList,List<Band> bandList,List<SellLevel> sellLevelList
<s_panel>
	<s_title slot="title">产品列表</s_title>
	<s_input name="productId" text="产品编号" value="@val("productId")"></s_input>
	<s_input name="productName" text="产品名" value="@val("productName")"></s_input>
	<s_select name="cateId" text="类别" value="@val("cateId")">
	@if(categoryList){@for(Category c : categoryList){
		<option value="@c.getCatId()">@c.getCatName()</option>
	}}
	</s_select>
	<s_select name="bandId" text="品牌" value="@val("bandId")">
	@if(bandList){@for(Band b : bandList){
		<option value="@b.getBandId()">@b.getBandName()</option>
	}}
	</s_select>
	<s_select name="sellLevel" text="销售级别" value="@val("sellLevel")">
	@if(sellLevelList){@for(SellLevel s : sellLevelList){
		<option value="@s.getLevel()">@s.getLevelName()</option>
	}}
	</s_select>
	<s_select name="recommend" text="推荐" value="@val("recommend")" deftext="所有">
		<option value="1">推荐</option>
		<option value="0">未推荐</option>
	</s_select>
	<s_buttons slot="button" cols="4">
		<s_button type="query"></s_button>
		<s_button type="link" icon="fa-plus" href="@url("add.html")">添加</s_button>
		<s_button type="link" icon="fa-pencil" href="@url("edit.html?productId={0}")">修改</s_button>
		<s_button type="del" href="@url("del.json?productId={0}")">删除</s_button>
	</s_buttons>
</s_panel>

<d_table min-width="1000px">
	<d_tr slot="head">
		<d_th class="td_row_id"></d_th>
		<d_th>产品编号</d_th>
		<d_th>产品名</d_th>
		<d_th>类别</d_th>
		<d_th>品牌</d_th>
		<d_th>主图片</d_th>
		<d_th>销售级别</d_th>
		<d_th>是否推荐</d_th>
		<d_th>更新时间</d_th>
	</d_tr>
	@if(productList){
	@{int i=0;}
	@for(Product p : productList){
	<d_tr slot="body" class="table_row @(i%2==0?"odd":"event")">
	@{i++;}
	<d_td class="td_row_id">
		<input type="checkbox" class="flat" name="__recordId" value="@p.getProductId()"/>
	</d_td>
	<d_td>@p.getProductId()</d_td>
	<d_td>@p.getProductName()</d_td>
	<d_td>@p.getCategoryName()</d_td>
	<d_td>@p.getBandName()</d_td>
	<d_td><img class="product-list-img" src="@p.getMainImg()"/></d_td>
	<d_td>@p.getSellLevelName()</d_td>
	<d_td>@BooleanEnum.valueOf(p.getRecommend())</d_td>
	<d_td>@p.getUpdateTime()</d_td>
	</d_tr>
	}
	}
</d_table>
